package com.zkthink.ceres.member.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 商城会员收货地址
 * </p>
 *
 * @author kellen
 * @since 2020-05-04
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_member_address")
@ApiModel(value = "MemberAddress", description = "商城会员收货地址")
@AllArgsConstructor
public class MemberAddress extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "收货地址id")
    @TableField("id")
    @Excel(name = "收货地址id")
    private Long id;

    /**
     * 会员ID
     */
    @ApiModelProperty(value = "会员ID")
    @TableField("mid")
    @Excel(name = "会员ID")
    private Long mid;

    /**
     * 收货人姓名
     */
    @ApiModelProperty(value = "收货人姓名")
    @Length(max = 20, message = "收货人姓名长度不能超过20")
    @TableField(value = "username", condition = LIKE)
    @Excel(name = "收货人姓名")
    private String username;

    /**
     * 收货手机号
     */
    @ApiModelProperty(value = "收货手机号")
    @Length(max = 16, message = "收货手机号长度不能超过16")
    @TableField(value = "phone", condition = LIKE)
    @Excel(name = "收货手机号")
    private String phone;

    /**
     * 收货地址省份
     */
    @ApiModelProperty(value = "收货地址省份")
    @Length(max = 50, message = "收货地址省份长度不能超过50")
    @TableField(value = "province", condition = LIKE)
    @Excel(name = "收货地址省份")
    private String province;

    /**
     * 收货地址城市
     */
    @ApiModelProperty(value = "收货地址城市")
    @Length(max = 50, message = "收货地址城市长度不能超过50")
    @TableField(value = "city", condition = LIKE)
    @Excel(name = "收货地址城市")
    private String city;

    /**
     * 收货地址区域
     */
    @ApiModelProperty(value = "收货地址区域")
    @Length(max = 255, message = "收货地址区域长度不能超过255")
    @TableField(value = "area", condition = LIKE)
    @Excel(name = "收货地址区域")
    private String area;

    /**
     * 地址标签
     */
    @ApiModelProperty(value = "地址标签")
    @Length(max = 32, message = "地址标签长度不能超过32")
    @TableField(value = "tag", condition = LIKE)
    @Excel(name = "地址标签")
    private String tag;

    /**
     * 城市信息
     */
    @ApiModelProperty(value = "城市信息")
    @Length(max = 200, message = "城市信息长度不能超过200")
    @TableField(value = "city_info", condition = LIKE)
    @Excel(name = "城市信息")
    private String cityInfo;

    /**
     * 收货详细地址
     */
    @ApiModelProperty(value = "收货详细地址")
    @Length(max = 255, message = "收货详细地址长度不能超过255")
    @TableField(value = "address", condition = LIKE)
    @Excel(name = "收货详细地址")
    private String address;

    /**
     * 默认收货地址(0否 1是)
     */
    @ApiModelProperty(value = "默认收货地址(0否 1是)")
    @TableField("is_default")
    @Excel(name = "默认收货地址(0否 1是)", replace = {"是_true", "否_false", "_null"})
    private Boolean isDefault;

    /**
     * 删除状态(1删除,0未删除)
     */
    @ApiModelProperty(value = "删除状态(1删除,0未删除)")
    @TableField("is_deleted")
    @Excel(name = "删除状态(1删除,0未删除)", replace = {"是_true", "否_false", "_null"})
    private Boolean isDeleted;


    @Builder
    public MemberAddress(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long mid, String username, String phone, String province, String city, 
                    String area, String tag, String cityInfo, String address, Boolean isDefault, Boolean isDeleted) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.mid = mid;
        this.username = username;
        this.phone = phone;
        this.province = province;
        this.city = city;
        this.area = area;
        this.tag = tag;
        this.cityInfo = cityInfo;
        this.address = address;
        this.isDefault = isDefault;
        this.isDeleted = isDeleted;
    }

}
